﻿using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class ResourceLoader : MonoBehaviour {
    static List<AssetBundle> LoadedBundles = new List<AssetBundle>();
    

//    public static Object LoadSound(string path)
//    {
//#if USE_ASSETBUNDLE
//        return LoadedBundles[(int)AssetBundleNames.Sound].Load(path);
//#else
//        return Resources.Load(name);
//#endif
//    }


	public static Object Load(string path)
    {
#if USE_ASSETBUNDLE
        return LoadedBundles[(int)AssetBundleNames.Charater].Load(path);
#else
        return Resources.Load(path);
#endif
    }


    public static Object Load(string path, System.Type type)
    {
#if USE_ASSETBUNDLE
        return LoadedBundles[(int)AssetBundleNames.Charater].Load(path);
#else
        return Resources.Load(path, type);
#endif
    }


//    public static Object Load(AssetBundleNames name , string path)
//    {
//#if USE_ASSETBUNDLE
//        return LoadedBundles[(int)name].Load(path);
//#else
//        return Resources.Load(path);
//#endif
//    }

    public static Object[] LoadAll(string path)
    {
#if USE_ASSETBUNDLE
        return LoadedBundles[(int)AssetBundleNames.Charater].LoadAll();
#else
        return Resources.LoadAll(path);
#endif
    }



}
